#!/bin/sh

set -e

# Author: Shu Peixuan
# Date: 2025-10-18

SCRIPT_DIR="$(cd "$(dirname "$0")" &&pwd)"
cd $SCRIPT_DIR

if [ -d "/usr/share/GeographicLib/geoids" ]; then
    echo -e "\e[32m------------------------------------------------------------------"
    echo -e "GeographicLib folder already exists in /usr/share. Exiting."
    echo -e "------------------------------------------------------------------\e[0m"
    exit 0
fi

sudo apt-get install unzip -y
mkdir -p GeographicLib/
sudo unzip GeographicLib.zip -d GeographicLib/
sudo mv GeographicLib/ /usr/share

echo -e "\e[32m------------------------------------------------------------------"
echo -e "Finish creating /usr/share/GeographicLib/!"
echo -e "------------------------------------------------------------------\e[0m"
